﻿using Microsoft.SharePoint;

namespace System.Modules.SharePoint.Contracts.DTO
{
    /// <summary>
    /// Event Receiver Definition
    /// </summary>
    public class EventReceiverDefinition
    {
        /// <summary>
        /// Name | string
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// Display Name | string 
        /// </summary>
        public string DisplayName { get; set; }
        /// <summary>
        /// Id | Guid
        /// </summary>
        public Guid Id { get; set; }
        /// <summary>
        /// Match | Method to check item that match.
        /// </summary>
        /// <param name="keyword"></param>
        /// <returns></returns>
        public bool Match(string keyword)
        {
            return DisplayName.Contains(keyword) || Id.ToString().Contains(keyword);
        }
        /// <summary>
        /// Assembly | string 
        /// </summary>
        public string Assembly { get; set; }
        /// <summary>
        /// Class | string 
        /// </summary>
        public string Class { get; set; }
        /// <summary>
        /// Sequence Number | Integer
        /// </summary>
        public int SequenceNumber { get; set; }
        /// <summary>
        /// Type | SPEventReceiverType
        /// </summary>
        public SPEventReceiverType Type { get; set; }
    }
}